Reset Password
Description
This API endpoint allows users to reset their password, based on the email Adress assosiated with the account. The Server will send out an Email to the users Email adress, with a link that includes
Endpoint
POST https://api.thenights.app/user_manager/resetpassword
Request
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| String | yes | the email adress the user account that is requesting the password reset is currently assosiated with |
Example Request Body
{
"email": "somemaile@thenights.app"
}
Response
For security reasons the endpoint returns a 200 error, even when the email is not found. The only acception is the "Email not verified" response
Success Response
Code: 200 OK
| Parameter | Type | Description |
|---|---|---|
| detail | String | - |
Example Response Body
{
"detail": "Password reset email sent."
}
Error Response
Code: 400 Bad Request
| Parameter | Type | Description |
|---|---|---|
| detail | String | - |
Example Response Body
{
"detail": "Email not verified."
}
Email
The Email adress generated includes a link that can be used to set a new password on "this" endpoint
Reset Link
https://thenights.app/resetpassword/' + urlsafe_base64_encode(force_bytes(user.pk)) + '/' + token
The token is generated using djangos secure default_token_generator